package com.cz.video.website.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cz.video.website.domain.WebsiteComment;
import com.cz.video.website.domain.bo.WebsiteCommentBo;
import com.cz.video.website.domain.vo.WebsiteCommentVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 评论表 Mapper 接口
 * </p>
 *
 * @author LLF
 * @since 2023-10-16
 */

public interface WebsiteCommentMapper extends BaseMapper<WebsiteComment> {

    Page<WebsiteCommentVo> selectPageCommentList(@Param(Constants.WRAPPER) Wrapper<WebsiteComment> queryWrapper,
                                                 @Param("page") Page<WebsiteCommentVo> page,
                                                 @Param("userId") Long userId);

    List<WebsiteCommentVo> selectPageCommentListWithUserDetails(Page<WebsiteCommentVo> page,
                                                                @Param(Constants.WRAPPER) WebsiteCommentBo queryWrapper);

    /**
     *
     * @param targetId
     * @return
     */
    int countAll(Long targetId);

    /**
     * 查询回复评论
     *
     * @param parentIdList 评论id列表
     * @param clientUserId
     * @return
     */
    List<WebsiteCommentVo> selectMostLikeReplyList(@Param("parentIdList") List<Long> parentIdList , @Param("clientUserId") Long clientUserId);
}
